2000W / 48V LLC Battery-Charger  V1.00
xmc_bccu.h
Go to the documentation of this file.
1 
59 #ifndef XMC_BCCU_H
60 #define XMC_BCCU_H
61 
62 /*********************************************************************************************************************
63  * HEADER FILES
64  ********************************************************************************************************************/
65 #include <xmc_common.h>
66 
138 #if defined (BCCU0)
139 
140 /*********************************************************************************************************************
141  * MACROS
142  ********************************************************************************************************************/
143 
144 /*********************************************************************************************************************
145  * ENUMS
146  ********************************************************************************************************************/
150  typedef enum {
151  XMC_BCCU_STATUS_SUCCESS = 0U,
152  XMC_BCCU_STATUS_ERROR = 1U,
153 } XMC_BCCU_STATUS_t;
154 
158 typedef enum {
159  XMC_BCCU_BCLK_MODE_NORMAL = 0U,
160  XMC_BCCU_BCLK_MODE_FAST = 1U,
161 } XMC_BCCU_BCLK_MODE_t;
162 
166 typedef enum {
167  XMC_BCCU_TRIGMODE0 = 0U,
168  XMC_BCCU_TRIGMODE1 = 1U,
169 } XMC_BCCU_TRIGMODE_t;
170 
174 typedef enum {
175  XMC_BCCU_TRIGDELAY_NO_DELAY = 0U,
176  XMC_BCCU_TRIGDELAY_QUARTER_BIT = 1U,
177  XMC_BCCU_TRIGDELAY_HALF_BIT = 2U,
178 } XMC_BCCU_TRIGDELAY_t;
179 
183 typedef enum {
184  XMC_BCCU_SUSPEND_MODE_IGNORE = 0U,
185  XMC_BCCU_SUSPEND_MODE_FREEZE = 1U,
187  XMC_BCCU_SUSPEND_MODE_SAFE_FREEZE = 2U,
189 } XMC_BCCU_SUSPEND_MODE_t;
190 
194 typedef enum {
195  XMC_BCCU_TRAPEDGE_RISING = 0U,
196  XMC_BCCU_TRAPEDGE_FALLING = 1U,
197 } XMC_BCCU_TRAPEDGE_t;
198 
203 typedef enum {
204  XMC_BCCU_EVENT_TRIGGER0 = 0x1U,
205  XMC_BCCU_EVENT_TRIGGER1 = 0x2U,
206  XMC_BCCU_EVENT_FIFOFULL = 0x4U,
207  XMC_BCCU_EVENT_FIFOEMPTY = 0x8U,
208  XMC_BCCU_EVENT_TRAP = 0x10U,
209 } XMC_BCCU_EVENT_t;
210 
215 typedef enum {
216  XMC_BCCU_EVENT_STATUS_TRIGGER0 = 0x1U,
217  XMC_BCCU_EVENT_STATUS_TRIGGER1 = 0x2U,
218  XMC_BCCU_EVENT_STATUS_FIFOFULL = 0x4U,
219  XMC_BCCU_EVENT_STATUS_FIFOEMPTY = 0x8U,
220  XMC_BCCU_EVENT_STATUS_TRAP = 0x10U,
221  XMC_BCCU_EVENT_STATUS_TRAP_STATE = 0x40U,
222 } XMC_BCCU_EVENT_STATUS_t;
223 
227 typedef enum {
228  XMC_BCCU_TRAP_STATUS_DEACTIVE = 0x0U,
229  XMC_BCCU_TRAP_STATUS_ACTIVE = 0x1U,
230 } XMC_BCCU_TRAP_STATUS_t;
231 
235 typedef enum {
236  XMC_BCCU_TRAP_LEVEL_LOW = 0x0U,
237  XMC_BCCU_TRAP_LEVEL_HIGH = 0x1U,
238 } XMC_BCCU_TRAP_LEVEL_t;
239 
243 typedef enum {
244  XMC_BCCU_CH_FLICKER_WD_DS = 0U,
245  XMC_BCCU_CH_FLICKER_WD_EN = 1U,
246 } XMC_BCCU_CH_FLICKER_WD_t;
247 
251 typedef enum {
252  XMC_BCCU_CH_GATING_FUNC_DISABLE = 0U,
253  XMC_BCCU_CH_GATING_FUNC_ENABLE = 1U,
254 } XMC_BCCU_CH_GATING_FUNC_t;
255 
259 typedef enum {
260  XMC_BCCU_CH_DIMMING_ENGINE_BYPASS_DISABLE = 0U,
261  XMC_BCCU_CH_DIMMING_ENGINE_BYPASS_ENABLE = 1U,
262 } XMC_BCCU_CH_DIMMING_ENGINE_BYPASS_t;
263 
267 typedef enum{
268  XMC_BCCU_CH_ACTIVE_LEVEL_HIGH = 0U,
269  XMC_BCCU_CH_ACTIVE_LEVEL_LOW = 1U,
270 } XMC_BCCU_CH_ACTIVE_LEVEL_t;
271 
275 typedef enum
276 {
277  XMC_BCCU_CH_TRIG_EDGE_PASS_TO_ACT = 0U,
278  XMC_BCCU_CH_TRIG_EDGE_ACT_TO_PASS = 1U,
279 } XMC_BCCU_CH_TRIG_EDGE_t;
280 
284 typedef enum
285 {
286  XMC_BCCU_CH_TRAP_INA = 0x0U,
287  XMC_BCCU_CH_TRAP_INB = 0x1U,
288  XMC_BCCU_CH_TRAP_INC = 0x2U,
289  XMC_BCCU_CH_TRAP_IND = 0x3U,
290  XMC_BCCU_CH_TRAP_INE = 0x4U,
291  XMC_BCCU_CH_TRAP_INF = 0x5U,
292  XMC_BCCU_CH_TRAP_ING = 0x6U,
293  XMC_BCCU_CH_TRAP_INH = 0x7U,
294  XMC_BCCU_CH_TRAP_INI = 0x8U,
295  XMC_BCCU_CH_TRAP_INJ = 0x9U,
296  XMC_BCCU_CH_TRAP_INK = 0xAU,
297  XMC_BCCU_CH_TRAP_INL = 0xBU,
298  XMC_BCCU_CH_TRAP_INM = 0xCU,
299  XMC_BCCU_CH_TRAP_INN = 0xDU,
300  XMC_BCCU_CH_TRAP_INO = 0xEU,
301  XMC_BCCU_CH_TRAP_INP = 0xFU,
302 } XMC_BCCU_CH_TRAP_IN_t;
303 
307 typedef enum
308 {
309  XMC_BCCU_CH_TRAP_EDGE_RISING = 0U,
310  XMC_BCCU_CH_TRAP_EDGE_FALLING = 1U
311 } XMC_BCCU_CH_TRAP_EDGE_t;
312 
316 typedef enum {
317  XMC_BCCU_CH_TRIGOUT0 = 0U,
318  XMC_BCCU_CH_TRIGOUT1 = 1U,
319 } XMC_BCCU_CH_TRIGOUT_t;
320 
324 typedef enum {
325  XMC_BCCU_CH_DIMMING_SOURCE_GLOBAL = 7U,
326  XMC_BCCU_CH_DIMMING_SOURCE_DE0 = 0U,
327  XMC_BCCU_CH_DIMMING_SOURCE_DE1 = 1U,
328  XMC_BCCU_CH_DIMMING_SOURCE_DE2 = 2U,
329 } XMC_BCCU_CH_DIMMING_SOURCE_t;
330 
334 typedef enum {
335  XMC_BCCU_DIM_CURVE_COARSE = 0U,
337  XMC_BCCU_DIM_CURVE_FINE = 1U,
338 } XMC_BCCU_DIM_CURVE_t;
339 
340 /*********************************************************************************************************************
341  * DATA STRUCTURES
342  ********************************************************************************************************************/
346 typedef BCCU_Type XMC_BCCU_t;
347 
351 typedef BCCU_CH_Type XMC_BCCU_CH_t;
352 
356 typedef BCCU_DE_Type XMC_BCCU_DIM_t;
357 
358 /*Anonymous structure/union guard start*/
359 #if defined(__CC_ARM)
360  #pragma push
361  #pragma anon_unions
362 #elif defined(__TASKING__)
363  #pragma warning 586
364 #endif
365 
369 typedef struct XMC_BCCU_GLOBAL_CONFIG
370 {
371  union{
372  struct{
373  uint32_t trig_mode:1;
374  uint32_t : 1;
375  uint32_t trig_delay:2;
377  uint32_t : 12;
378  uint32_t maxzero_at_output:12;
379  };
380  uint32_t globcon; /* Not to use */
381  };
382  union{
383  struct{
384  uint32_t fclk_ps:12;
385  uint32_t : 3;
386  uint32_t bclk_sel:1;
387  uint32_t dclk_ps:12;
388  };
389  uint32_t globclk; /* Not to use */
390  };
391  uint32_t global_dimlevel;
392 } XMC_BCCU_GLOBAL_CONFIG_t;
393 
394 
398 typedef struct XMC_BCCU_TRIG_CONFIG
399 {
400  XMC_BCCU_TRIGMODE_t mode;
401  XMC_BCCU_TRIGDELAY_t delay;
402  uint16_t mask_chans;
404  uint16_t mask_trig_lines;
405 } XMC_BCCU_TRIG_CONFIG_t;
406 
410 #ifdef DOXYGEN
411 typedef struct XMC_BCCU_CH_CONFIG
412 {
413  uint32_t pack_thresh:3;
414  uint32_t pack_en:1;
415  uint32_t dim_sel:3;
416  uint32_t dim_bypass:1;
417  uint32_t gate_en:1;
418  uint32_t flick_wd_en:1;
419  uint32_t trig_edge:1;
420  uint32_t force_trig_en:1;
422  uint32_t pack_offcmp_lev:8;
424  uint32_t pack_oncmp_lev:8;
426  uint32_t pack_offcnt_val:8;
428  uint32_t pack_oncnt_val:8;
430 }XMC_BCCU_CH_CONFIG_t;
431 #endif
432 
433 typedef struct XMC_BCCU_CH_CONFIG
434 {
435  union{
436  struct{
437  uint32_t pack_thresh:3;
438  uint32_t pack_en:1;
439  uint32_t dim_sel:3;
441  uint32_t dim_bypass:1;
442  uint32_t gate_en:1;
443  uint32_t flick_wd_en:1;
444  uint32_t trig_edge:1;
445  uint32_t force_trig_en:1;
447  };
448  uint32_t chconfig; /* Not to use */
449  };
450  union{
451  struct{
452  uint32_t pack_offcmp_lev:8;
454  uint32_t : 8;
455  uint32_t pack_oncmp_lev:8;
457  };
458  uint32_t pkcmp; /* Not to use */
459  };
460  union{
461  struct{
462  uint32_t pack_offcnt_val:8;
464  uint32_t : 8;
465  uint32_t pack_oncnt_val:8;
467  };
468  uint32_t pkcntr; /* Not to use */
469  };
470 }XMC_BCCU_CH_CONFIG_t;
471 
475 #ifdef DOXYGEN
476 typedef struct XMC_BCCU_DIM_CONFIG
477 {
478  uint32_t dim_div:10;
480  uint32_t dither_en:1;
481  uint32_t cur_sel:1;
483 }XMC_BCCU_DIM_CONFIG_t;
484 #endif
485 
486 typedef struct XMC_BCCU_DIM_CONFIG
487 {
488  union{
489  struct{
490  uint32_t dim_div:10;
492  uint32_t : 6;
493  uint32_t dither_en:1;
494  uint32_t cur_sel:1;
496  };
497  uint32_t dtt; /* Not to use */
498  };
499 }XMC_BCCU_DIM_CONFIG_t;
500 
501 /*Anonymous structure/union guard end*/
502 #if defined(__CC_ARM)
503  #pragma pop
504 #elif defined(__TASKING__)
505  #pragma warning restore
506 #endif
507 /*********************************************************************************************************************
508  * API PROTOTYPES
509  ********************************************************************************************************************/
510 #ifdef __cplusplus
511 extern "C" {
512 #endif
513 
530 void XMC_BCCU_GlobalInit (XMC_BCCU_t *const bccu, const XMC_BCCU_GLOBAL_CONFIG_t *const config);
531 
551 void XMC_BCCU_ConfigGlobalTrigger(XMC_BCCU_t *const bccu, XMC_BCCU_TRIGMODE_t mode, XMC_BCCU_TRIGDELAY_t delay);
552 
567 __STATIC_INLINE uint32_t XMC_BCCU_ReadGlobalTrigger (XMC_BCCU_t *const bccu)
568 {
569  return (uint32_t)(bccu->GLOBCON & BCCU_GLOBCON_TM_Msk);
570 }
571 
587 void XMC_BCCU_SelectTrapInput (XMC_BCCU_t *const bccu, XMC_BCCU_CH_TRAP_IN_t input);
588 
603 __STATIC_INLINE uint32_t XMC_BCCU_ReadTrapInput (XMC_BCCU_t *const bccu)
604 {
605  return (uint32_t)(( (bccu->GLOBCON) & BCCU_GLOBCON_TRAPIS_Msk) >> BCCU_GLOBCON_TRAPIS_Pos);
606 }
607 
622 void XMC_BCCU_SetTrapEdge (XMC_BCCU_t *const bccu, XMC_BCCU_CH_TRAP_EDGE_t edge);
623 
638 __STATIC_INLINE uint32_t XMC_BCCU_ReadTrapEdge (XMC_BCCU_t *const bccu)
639 {
640  return (uint32_t)(( (bccu->GLOBCON) & BCCU_GLOBCON_TRAPED_Msk) >> BCCU_GLOBCON_TRAPED_Pos);
641 }
642 
657 void XMC_BCCU_ConfigSuspendMode (XMC_BCCU_t *const bccu, XMC_BCCU_SUSPEND_MODE_t mode);
658 
674 __STATIC_INLINE uint32_t XMC_BCCU_ReadSuspendMode (XMC_BCCU_t *const bccu)
675 {
676  return (uint32_t)( ((bccu->GLOBCON) & BCCU_GLOBCON_SUSCFG_Msk) >> BCCU_GLOBCON_SUSCFG_Pos);
677 }
678 
693 __STATIC_INLINE uint32_t XMC_BCCU_ReadLastTrigChanNr (XMC_BCCU_t *const bccu)
694 {
695  return (uint32_t)(( (bccu->GLOBCON) & BCCU_GLOBCON_LTRS_Msk) >> BCCU_GLOBCON_LTRS_Pos);
696 }
697 
712 void XMC_BCCU_SetFlickerWDThreshold (XMC_BCCU_t *const bccu, uint32_t threshold_no);
713 
726 __STATIC_INLINE uint32_t XMC_BCCU_ReadFlickerWDThreshold (XMC_BCCU_t *const bccu)
727 {
728  return (uint32_t)(( (bccu->GLOBCON) & BCCU_GLOBCON_WDMBN_Msk) >> BCCU_GLOBCON_WDMBN_Pos);
729 }
730 
744 void XMC_BCCU_SetFastClockPrescaler (XMC_BCCU_t *const bccu, uint32_t div);
745 
758 __STATIC_INLINE uint32_t XMC_BCCU_ReadFastClock (XMC_BCCU_t *const bccu)
759 {
760  return (uint32_t)(((bccu->GLOBCLK) & BCCU_GLOBCLK_FCLK_PS_Msk) >> BCCU_GLOBCLK_FCLK_PS_Pos);
761 }
762 
776 void XMC_BCCU_SetDimClockPrescaler (XMC_BCCU_t *const bccu, uint32_t div);
777 
790 __STATIC_INLINE uint32_t XMC_BCCU_ReadDimClock (XMC_BCCU_t *const bccu)
791 {
792  return (uint32_t)(((bccu->GLOBCLK) & BCCU_GLOBCLK_DCLK_PS_Msk) >> BCCU_GLOBCLK_DCLK_PS_Pos);
793 }
794 
808 void XMC_BCCU_SelectBitClock (XMC_BCCU_t *const bccu, XMC_BCCU_BCLK_MODE_t div);
809 
824 __STATIC_INLINE uint32_t XMC_BCCU_ReadBitClock (XMC_BCCU_t *const bccu)
825 {
826  return (uint32_t)(((bccu->GLOBCLK) & BCCU_GLOBCLK_BCS_Msk) >> BCCU_GLOBCLK_BCS_Pos);
827 }
828 
847 void XMC_BCCU_ConcurrentEnableChannels (XMC_BCCU_t *const bccu, uint32_t mask);
848 
867 void XMC_BCCU_ConcurrentDisableChannels (XMC_BCCU_t *const bccu, uint32_t mask);
868 
889 void XMC_BCCU_ConcurrentSetOutputPassiveLevel(XMC_BCCU_t *const bccu, uint32_t chan_mask, XMC_BCCU_CH_ACTIVE_LEVEL_t level);
890 
909 void XMC_BCCU_ConcurrentEnableTrap (XMC_BCCU_t *const bccu, uint32_t mask);
910 
929 void XMC_BCCU_ConcurrentDisableTrap (XMC_BCCU_t *const bccu, uint32_t mask);
930 
946 void XMC_BCCU_ConcurrentConfigTrigger (XMC_BCCU_t *const bccu, XMC_BCCU_TRIG_CONFIG_t *trig);
947 
967 void XMC_BCCU_ConcurrentStartLinearWalk (XMC_BCCU_t *const bccu, uint32_t mask);
968 
988 void XMC_BCCU_ConcurrentAbortLinearWalk (XMC_BCCU_t *const bccu, uint32_t mask);
989 
1008 void XMC_BCCU_ConcurrentEnableDimmingEngine (XMC_BCCU_t *const bccu, uint32_t mask);
1009 
1028 void XMC_BCCU_ConcurrentDisableDimmingEngine (XMC_BCCU_t *const bccu, uint32_t mask);
1029 
1049 void XMC_BCCU_ConcurrentStartDimming (XMC_BCCU_t *const bccu, uint32_t mask);
1050 
1070 void XMC_BCCU_ConcurrentAbortDimming (XMC_BCCU_t *const bccu, uint32_t mask);
1071 
1086 void XMC_BCCU_SetGlobalDimmingLevel (XMC_BCCU_t *const bccu, uint32_t level);
1087 
1104 __STATIC_INLINE void XMC_BCCU_EnableInterrupt (XMC_BCCU_t *const bccu, uint32_t event)
1105 {
1106  bccu->EVIER |= event;
1107 }
1108 
1125 __STATIC_INLINE void XMC_BCCU_DisableInterrupt (XMC_BCCU_t *const bccu, uint32_t event)
1126 {
1127  bccu->EVIER &= (uint32_t)~(event);
1128 }
1129 
1142 __STATIC_INLINE uint32_t XMC_BCCU_ReadEventFlag (XMC_BCCU_t *const bccu)
1143 {
1144  return (bccu->EVFR);
1145 }
1146 
1164 __STATIC_INLINE void XMC_BCCU_SetEventFlag (XMC_BCCU_t *const bccu, uint32_t flag_type)
1165 {
1166  bccu->EVFSR = flag_type;
1167 }
1168 
1187 __STATIC_INLINE void XMC_BCCU_ClearEventFlag (XMC_BCCU_t *const bccu, uint32_t flag_type)
1188 {
1189  bccu->EVFCR = flag_type;
1190 }
1191 
1205 void XMC_BCCU_EnableChannel (XMC_BCCU_t *const bccu, uint32_t chan_no);
1206 
1220 void XMC_BCCU_DisableChannel (XMC_BCCU_t *const bccu, uint32_t chan_no);
1221 
1237 void XMC_BCCU_SetOutputPassiveLevel(XMC_BCCU_t *const bccu, uint32_t chan_no, XMC_BCCU_CH_ACTIVE_LEVEL_t level);
1238 
1252 void XMC_BCCU_EnableTrap (XMC_BCCU_t *const bccu, uint32_t chan_no);
1253 
1267 void XMC_BCCU_DisableTrap (XMC_BCCU_t *const bccu, uint32_t chan_no);
1268 
1284 void XMC_BCCU_EnableChannelTrigger (XMC_BCCU_t *const bccu, uint32_t chan_no, XMC_BCCU_CH_TRIGOUT_t trig_line);
1285 
1299 void XMC_BCCU_DisableChannelTrigger (XMC_BCCU_t *const bccu, uint32_t chan_no);
1300 
1317 void XMC_BCCU_CH_Init (XMC_BCCU_CH_t *const channel, const XMC_BCCU_CH_CONFIG_t *const config);
1318 
1336 void XMC_BCCU_CH_ConfigTrigger (XMC_BCCU_CH_t *const channel, XMC_BCCU_CH_TRIG_EDGE_t edge, uint32_t force_trig_en);
1337 
1353 __STATIC_INLINE void XMC_BCCU_StartLinearWalk (XMC_BCCU_t *const bccu, uint32_t chan_no)
1354 {
1355  bccu->CHSTRCON |= (uint32_t)(BCCU_CHSTRCON_CH0S_Msk << chan_no);
1356 }
1357 
1372 __STATIC_INLINE void XMC_BCCU_AbortLinearWalk (XMC_BCCU_t *const bccu, uint32_t chan_no)
1373 {
1374  bccu->CHSTRCON |= (uint32_t)(BCCU_CHSTRCON_CH0A_Msk << chan_no);
1375 }
1376 
1390 __STATIC_INLINE uint32_t XMC_BCCU_GetChannelOutputLvlAtLastTrigger (XMC_BCCU_t *const bccu, uint32_t chan_no)
1391 {
1392  return (uint32_t)((bccu->LTCHOL & (BCCU_LTCHOL_LTOL0_Msk << chan_no)) >> chan_no);
1393 }
1394 
1406 void XMC_BCCU_CH_SetLinearWalkPrescaler (XMC_BCCU_CH_t *const channel, uint32_t clk_div);
1407 
1420 __STATIC_INLINE uint32_t XMC_BCCU_IsLinearWalkComplete (XMC_BCCU_t *const bccu, uint32_t chan_no)
1421 {
1422  return (uint32_t)((bccu->CHSTRCON & (BCCU_CHSTRCON_CH0S_Msk << chan_no)) >> chan_no);
1423 }
1424 
1439 void XMC_BCCU_CH_SetTargetIntensity (XMC_BCCU_CH_t *const channel, uint32_t ch_int);
1440 
1452 uint32_t XMC_BCCU_CH_ReadIntensity (XMC_BCCU_CH_t *const channel);
1453 
1474 void XMC_BCCU_CH_EnablePacker (XMC_BCCU_CH_t *const channel, uint32_t thresh, uint32_t off_comp, uint32_t on_comp);
1475 
1489 void XMC_BCCU_CH_SetPackerThreshold (XMC_BCCU_CH_t *const channel, uint32_t val);
1490 
1506 void XMC_BCCU_CH_SetPackerOffCompare (XMC_BCCU_CH_t *const channel, uint32_t level);
1507 
1523 void XMC_BCCU_CH_SetPackerOnCompare (XMC_BCCU_CH_t *const channel, uint32_t level);
1524 
1536 __STATIC_INLINE uint32_t XMC_BCCU_CH_ReadPackerThreshold (XMC_BCCU_CH_t *const channel)
1537 {
1538  return (uint32_t)((channel->CHCONFIG) & BCCU_CH_CHCONFIG_PKTH_Msk);
1539 }
1540 
1553 __STATIC_INLINE uint32_t XMC_BCCU_CH_ReadPackerOffCompare (XMC_BCCU_CH_t *const channel)
1554 {
1555  return (uint32_t)((channel->PKCMP) & BCCU_CH_PKCMP_OFFCMP_Msk);
1556 }
1557 
1570 __STATIC_INLINE uint32_t XMC_BCCU_CH_ReadPackerOnCompare (XMC_BCCU_CH_t *const channel)
1571 {
1572  return (uint32_t)(((channel->PKCMP) & BCCU_CH_PKCMP_ONCMP_Msk) >> BCCU_CH_PKCMP_ONCMP_Pos);
1573 }
1574 
1587 void XMC_BCCU_CH_DisablePacker (XMC_BCCU_CH_t *const channel);
1588 
1604 void XMC_BCCU_CH_SetPackerOffCounter (XMC_BCCU_CH_t *const channel, uint32_t cnt_val);
1605 
1621 void XMC_BCCU_CH_SetPackerOnCounter (XMC_BCCU_CH_t *const channel, uint32_t cnt_val);
1622 
1636 void XMC_BCCU_CH_SelectDimEngine (XMC_BCCU_CH_t *const channel, XMC_BCCU_CH_DIMMING_SOURCE_t sel);
1637 
1650 void XMC_BCCU_CH_EnableDimmingBypass (XMC_BCCU_CH_t *const channel);
1651 
1664 void XMC_BCCU_CH_DisableDimmingBypass (XMC_BCCU_CH_t *const channel);
1665 
1679 __STATIC_INLINE void XMC_BCCU_CH_EnableGating (XMC_BCCU_CH_t *const channel)
1680 {
1681  channel->CHCONFIG |= (uint32_t)(BCCU_CH_CHCONFIG_GEN_Msk);
1682 }
1683 
1697 __STATIC_INLINE void XMC_BCCU_CH_DisableGating (XMC_BCCU_CH_t *const channel)
1698 {
1699  channel->CHCONFIG &= ~(uint32_t)(BCCU_CH_CHCONFIG_GEN_Msk);
1700 }
1701 
1716 __STATIC_INLINE void XMC_BCCU_CH_EnableFlickerWatchdog (XMC_BCCU_CH_t *const channel)
1717 {
1718  channel->CHCONFIG |= (uint32_t)(BCCU_CH_CHCONFIG_WEN_Msk);
1719 }
1720 
1735 __STATIC_INLINE void XMC_BCCU_CH_DisableFlickerWatchdog (XMC_BCCU_CH_t *const channel)
1736 {
1737  channel->CHCONFIG &= ~(uint32_t)(BCCU_CH_CHCONFIG_WEN_Msk);
1738 }
1739 
1754 void XMC_BCCU_DIM_Init (XMC_BCCU_DIM_t *const dim_engine, const XMC_BCCU_DIM_CONFIG_t *const config);
1755 
1769 __STATIC_INLINE void XMC_BCCU_EnableDimmingEngine (XMC_BCCU_t *const bccu, uint32_t dim_no)
1770 {
1771  bccu->DEEN |= (uint32_t)(BCCU_DEEN_EDE0_Msk << dim_no);
1772 }
1773 
1787 __STATIC_INLINE void XMC_BCCU_DisableDimmingEngine (XMC_BCCU_t *const bccu, uint32_t dim_no)
1788 {
1789  bccu->DEEN &= ~(uint32_t)(BCCU_DEEN_EDE0_Msk << dim_no);
1790 }
1791 
1806 __STATIC_INLINE void XMC_BCCU_StartDimming (XMC_BCCU_t *const bccu, uint32_t dim_no)
1807 {
1808  bccu->DESTRCON = (uint32_t)(BCCU_DESTRCON_DE0S_Msk << dim_no);
1809 }
1810 
1825 __STATIC_INLINE void XMC_BCCU_AbortDimming (XMC_BCCU_t *const bccu, uint32_t dim_no)
1826 {
1827  bccu->DESTRCON = (uint32_t)(BCCU_DESTRCON_DE0A_Msk << dim_no);
1828 }
1829 
1843 __STATIC_INLINE uint32_t XMC_BCCU_IsDimmingFinished (XMC_BCCU_t *const bccu, uint32_t dim_no)
1844 {
1845  return (uint32_t)((bccu->DESTRCON & (BCCU_DESTRCON_DE0S_Msk << dim_no)) >> dim_no);
1846 }
1847 
1863 void XMC_BCCU_DIM_SetTargetDimmingLevel (XMC_BCCU_DIM_t *const dim_engine, uint32_t level);
1864 
1876 __STATIC_INLINE uint32_t XMC_BCCU_DIM_ReadDimmingLevel (XMC_BCCU_DIM_t *const dim_engine)
1877 {
1878  return (uint32_t)(dim_engine->DL & BCCU_DE_DL_DLEV_Msk);
1879 }
1880 
1895 void XMC_BCCU_DIM_SetDimDivider (XMC_BCCU_DIM_t *const dim_engine, uint32_t div);
1896 
1908  __STATIC_INLINE uint32_t XMC_BCCU_DIM_ReadDimDivider(XMC_BCCU_DIM_t *const dim_engine)
1909 {
1910  return (uint32_t)(dim_engine->DTT & BCCU_DE_DTT_DIMDIV_Msk);
1911 }
1912 
1928 void XMC_BCCU_DIM_ConfigDimCurve (XMC_BCCU_DIM_t *const dim_engine, uint32_t dither_en, XMC_BCCU_DIM_CURVE_t sel);
1929 
1941 __STATIC_INLINE XMC_BCCU_DIM_CURVE_t XMC_BCCU_DIM_GetDimCurve (XMC_BCCU_DIM_t *const dim_engine)
1942 {
1943  return (XMC_BCCU_DIM_CURVE_t)((dim_engine->DTT & BCCU_DE_DTT_CSEL_Msk) >> BCCU_DE_DTT_CSEL_Pos);
1944 }
1945 
1957 __STATIC_INLINE uint32_t XMC_BCCU_IsDitherEnable(XMC_BCCU_DIM_t *const dim_engine)
1958 {
1959  return (uint32_t)((dim_engine->DTT & BCCU_DE_DTT_DTEN_Msk) >> BCCU_DE_DTT_DTEN_Pos);
1960 }
1961 
1970 #ifdef __cplusplus
1971 }
1972 #endif
1973 
1974 #endif /* BCCU0 */
1975 
1976 #endif /* XMC_BCCU_H */
#define BCCU_CH_PKCMP_ONCMP_Msk
Definition: XMC1400.h:7546
#define BCCU_GLOBCON_WDMBN_Msk
Definition: XMC1400.h:7254
#define BCCU_GLOBCLK_DCLK_PS_Msk
Definition: XMC1400.h:7262
#define BCCU_DE_DTT_CSEL_Pos
Definition: XMC1400.h:7573
#define BCCU_GLOBCON_TRAPIS_Msk
Definition: XMC1400.h:7248
#define BCCU_GLOBCON_LTRS_Msk
Definition: XMC1400.h:7252
#define BCCU_CHSTRCON_CH0S_Msk
Definition: XMC1400.h:7370
#define BCCU_CH_CHCONFIG_WEN_Msk
Definition: XMC1400.h:7534
#define BCCU_DE_DTT_DTEN_Pos
Definition: XMC1400.h:7571
#define BCCU_DE_DTT_DTEN_Msk
Definition: XMC1400.h:7572
#define BCCU_GLOBCON_SUSCFG_Msk
Definition: XMC1400.h:7246
#define BCCU_DE_DTT_CSEL_Msk
Definition: XMC1400.h:7574
#define BCCU_CH_CHCONFIG_PKTH_Msk
Definition: XMC1400.h:7524
#define BCCU_DE_DTT_DIMDIV_Msk
Definition: XMC1400.h:7570
#define BCCU_DEEN_EDE0_Msk
Definition: XMC1400.h:7428
#define BCCU_GLOBCLK_FCLK_PS_Msk
Definition: XMC1400.h:7258
#define BCCU_GLOBCON_TRAPED_Msk
Definition: XMC1400.h:7250
#define BCCU_DESTRCON_DE0S_Msk
Definition: XMC1400.h:7436
#define BCCU_GLOBCLK_FCLK_PS_Pos
Definition: XMC1400.h:7257
#define BCCU_CHSTRCON_CH0A_Msk
Definition: XMC1400.h:7388
#define BCCU_GLOBCON_TM_Msk
Definition: XMC1400.h:7242
#define BCCU_CH_CHCONFIG_GEN_Msk
Definition: XMC1400.h:7532
#define BCCU_GLOBCON_TRAPED_Pos
Definition: XMC1400.h:7249
#define BCCU_DE_DL_DLEV_Msk
Definition: XMC1400.h:7566
BCCU Unit 0 (BCCU_DE)
Definition: XMC1400.h:1164
#define BCCU_CH_PKCMP_ONCMP_Pos
Definition: XMC1400.h:7545
#define BCCU_GLOBCON_WDMBN_Pos
Definition: XMC1400.h:7253
#define BCCU_GLOBCON_SUSCFG_Pos
Definition: XMC1400.h:7245
#define BCCU_GLOBCON_LTRS_Pos
Definition: XMC1400.h:7251
#define BCCU_GLOBCLK_BCS_Msk
Definition: XMC1400.h:7260
#define BCCU_DESTRCON_DE0A_Msk
Definition: XMC1400.h:7442
#define __STATIC_INLINE
Definition: cmsis_gcc.h:47
BCCU Unit 0 (BCCU)
Definition: XMC1400.h:1118
#define BCCU_GLOBCLK_DCLK_PS_Pos
Definition: XMC1400.h:7261
BCCU Unit 0 (BCCU_CH)
Definition: XMC1400.h:1146
#define BCCU_GLOBCLK_BCS_Pos
Definition: XMC1400.h:7259
#define BCCU_GLOBCON_TRAPIS_Pos
Definition: XMC1400.h:7247
#define BCCU_CH_PKCMP_OFFCMP_Msk
Definition: XMC1400.h:7544
static void delay(uint32_t cycles)
Definition: xmc1_scu.c:289